home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 2 / Mac Magazin and MacEasy Magazine CD - Issue 02.iso / Sharewarebibliothek / Applikationen / Sparkle212 folder / (Docs) / README 2nd < prev    next >
Text File  |  1994-07-28  |  39KB  |  748 lines

  1. Sparkle: A new mac MPEG player.
  2. -------------------------------
  3. Documents for version 2.11
  4. This document looks best in 9 point monaco.
  5. On an MPW marks aware editor (like Alpha) this document has marks for 
  6. each section.
  7.  
  8. This document contains the following sections:
  9. INTRODUCTION
  10. LEGALITIES
  11. SAVING TO MPEG
  12. FAQs
  13. WHY DOESN'T SPARKLE DO....
  14. SMALL THINGS YOU MIGHT NOT HAVE NOTICED
  15. THE FUTURE
  16. HOW CAN YOU HELP IMPROVE SPARKLE?
  17.  
  18. ------------------------------------------------------------------------------
  19. INTRODUCTION
  20.  
  21. Hi there, friendly users. This is release 2.1 1of my mac MPEG player.
  22. Version 1.0 of this code was based on the Berkeley MPEG unix code.
  23. (Anyone who wants to play with the Berkeley code can get it from 
  24. toe.cs.berkeley.edu in pub/multimedia/mpeg.) It was released as soon as 
  25. it was usable. This version has had pretty much all of the Berkeley code 
  26. rewritten for greater speed, smaller memory footprint, and more flexibility.
  27.  
  28. Version 2.0 of this code makes use of the Berkeley MPEG encoder, available 
  29. from the same place as above. Like version 1.0, this Berkeley code has not 
  30. been touched much except to make it Mac aware, object oriented, and thread 
  31. based. As a result, MPEG encoding is slow and a ridiculous memory hog 
  32. (what do you expect from UNIX coders---they seem to have no interest in 
  33. elegant design)? 
  34. As time permits I'll be going through that encoding code to make it faster 
  35. and use less memory.
  36.  
  37. Notice that there is a section of this document called FAQs.
  38. Please read it before sending me mail, thus avoiding wasting your time and 
  39. mine.
  40.  
  41. Please read all of this document before playing with the program. While 
  42. actually using the program is pretty simple, there are a few things you 
  43. should be aware of. Many of you may not care when I waffle on about 
  44. technical details. However I would ask all programmer readers (especially 
  45. people knowledgable about QuickTime, and especially Apple [and 
  46. ex-Apple :-( employees] to look at the tech sections and help me out with 
  47. comments and suggestions. Each time someone gives me a pointer on how to 
  48. do something it cuts a week or more off the release date of the next 
  49. version of Sparkle. 
  50.  
  51. Features:
  52. •    Standard mac interface with menus and windows.
  53. •    Uses the QuickTime movie controller to control the MPEG viewing.
  54. •    MultiFinder friendly, with good backgrounding behavior.
  55. •    Saves MPEGs to QuickTime movies.
  56. •    Can open multiple files at once.
  57. •   Can open QuickTime movies and sets of PICTs.
  58. •   Can encode MPEGs.
  59. •    Free.
  60.  
  61. To run it needs at least:
  62. •    System 7.
  63. •    QuickTime 1.6
  64. •    A 68020 or better.
  65. •    800K to play one 160x120 MPEG---to open more or large MPEGs increase the
  66.     partition. 
  67.     Encoding MPEGs requires much more memory---about a minimum of 1600K for a 
  68.     160x120 source. 
  69. •    The Thread Manager. Right now, the Thread Manager is an extension 
  70.     that you can get from any friend who knows a lot about macs, or from the 
  71.     apple ftp site. Ftp to ftp.apple.com and look in 
  72.     dts/mac/sys.soft/extensions for Thread_manager_201.hqx
  73.     I wish I could distribute it with Sparkle, but Apple's lawyers won't 
  74.     allow that. 
  75.     (Question for you as a user, does it make your Macintosh experience 
  76.     better or worse to find that a vital piece you need to run a program is 
  77.     not available with that program? Now try to explain that to Apple 
  78.     management, who sometime seem determined to make using a mac as difficult 
  79.     an experience as using a PC.)
  80.     The Thread Manager may be built into System 7.5 when that's released, at 
  81.     which point you won't need the extension.
  82.     
  83. This program works fine, with good handling of errors, on my Quadra 610, but 
  84. that's the only machine I have to test it. If you find a bug that is not 
  85. caused by the various things listed below, please mail me with as many 
  86. details as possible, both about your machine and about what the  program 
  87. was last doing before it died on you.
  88.  
  89. I don't think there's much to say on the use of this program---you pretty 
  90. much run it like any other mac program. There is a section in this 
  91. document on tips that may not be obvious. 
  92. When opening files, you can choose to show all files, or only files with a 
  93. .mpg suffix.
  94. If you choose the "show all files" option and open some random file, don't 
  95. be surprised when you are told that that is not a valid MPEG file.
  96. If you set the option to change file types, the file type of the MPEG file 
  97. you are changing will be changed to a Sparkle file, which will give it a 
  98. nice icon and allow you to open the file by double-clicking on it.
  99.  
  100. Underneath the movie controller for each window is a progress bar which 
  101. will update itself when slow things are happening. If you have a fast 
  102. machine (say a Quadra or Centris) this won't have to update itself much, 
  103. except if you open large (and not too common) MPEGs---say 320x240. If you 
  104. really want to see what the progress update looks like, try having lots of 
  105. MPEGs playing at once, then switch Sparkle into the background. 
  106. If you save an MPEG to QuickTime using Cinepak, your machine may appear to 
  107. freeze while each frame is being converted. I have installed code to 
  108. reduce the extent of the freeze, but basically this is a bug with 
  109. QuickTime---the system just grabs control and won't let go for about five 
  110. seconds. Maybe this'll be fixed in QuickTime 2.0 if we're lucky.
  111.  
  112. I have tested this program extensively under low-memory conditions when it 
  113. opens files and plays them.  It should never crash under those conditions.  
  114. In 600K you can easily open, play and save to QT a 120x160 I-frame MPEG.  In 
  115. 1500K you can open, play and save to QT a 320x240 IBP-frame MPEG.
  116.  
  117. Disk errors in various forms (bad sectors reading an MPEG file, no disk 
  118. space writing an QuickTime file, etc) will not crash, but the system will 
  119. put up an error alert and not handle the error very well (for example you 
  120. won't be given a chance to destroy old files to free up space on a disk). 
  121. Decent recovery from disk errors is on the list of things to do.
  122.  
  123. ------------------------------------------------------------------------------
  124. LEGALITIES
  125.  
  126. This program can be freely distributed.
  127. If you want to include it on a CD-ROM collection, please ask me first, 
  128. but I'll probably allow you.
  129. NOTE: Some authors will not allow their stuff to be distributed on CD-ROMs 
  130. for which people have to pay. I would ask these authors to consider things 
  131. more carefully. Many people (like myself) do not have very good ftp access 
  132. and a CD ROM of stuff is a godsend, even if we do have to pay a little for 
  133. it. Think about it.
  134. The only people I won't allow to carry it are ZiffNet because I feel their 
  135. download policies are unfair. (As I understand things, ZiffNet put up for 
  136. downloading stuff they pull off the InterNet, but won't allow the InterNet 
  137. to distribute their stuff. If I am wrong about this, someone please tell 
  138. me and I'll change this clause.)
  139.  
  140. If you feel a desperate need to thank me for this program, send me a 
  141. floppy of interesting MPEGs or QT movies you've picked up. 
  142. (Please don't e-mail me large files without warning.)
  143. My paper-mail address is 
  144.     Maynard Handley
  145.     ADI
  146.     284 Stuart Street
  147.     Dunedin
  148.     New Zealand
  149.  
  150. ------------------------------------------------------------------------------
  151. SAVING TO MPEG
  152.  
  153. The dialog box offering options when you save to MPEG is not that great 
  154. right now if you don't know what you're doing. I'm sorry---I'll fix it 
  155. when I have time, like everything else.
  156.  
  157. For a better explanation of how MPEG works, read the Technical Notes file 
  158. in this package, but here are rough details.
  159.  
  160. When encoding your MPEG you will need to decide what types of frames you 
  161. want to use. If you want your MPEG to be read widely, ie on PC systems, 
  162. you should consider using only I-frames. The most common MPEG decoder on 
  163. PCs is the Xing decoder which only understands the simple I-frame MPEG 
  164. format. If you want to get the best possible compression you should use 
  165. I, P and B frames, but then your MPEG will only be able to be read by 
  166. smarter decoders. A compromise is to use only I and P frames. This will 
  167. give you a lot of the compression benefit of I, P and B frames, but will 
  168. be faster to encode. 
  169.  
  170. If you don't want to know the details of these frames, choose a frame 
  171. pattern from the popup menu. 
  172. If you want to create your own frame pattern, here are some details:
  173. (If you don't want to create your own frame pattern, ignore these.)
  174. 1) The first frame in the MPEG will always be I. That implicit I frame is 
  175.     displayed in front of the frame pattern text you enter because it is 
  176.     always there and you don't need to put it in. That implicit I frame is 
  177.     only used for the first frame, after that your pattern is repeated as 
  178.     necessary. Thus if your pattern is BBPBBI, the encoder will encode frames 
  179.     using the sequence I BBPBBI BBPBBI BBPBBI ...
  180.     (For people who care about MPEG details, this is the playback order
  181.     of the frames. The actual order of the frames stored in the file 
  182.     will be be I PBBIBB PBBIBB PBBIBB.)
  183. 2) If you are using B frames, you have to start off with two referential 
  184.     frames, the initial I frame then either an I or a P frame.
  185. 3) The last few frames of the MPEG, if they would be B frames, will be 
  186.     converted to I-frames. (If this didn't occur, like in the original 
  187.     Berkeley encoder code before I munged it, you will lose those final 
  188.     frames.)
  189. 4) Don't create too long a pattern of Ps or Bs. You'll start to lose 
  190.     quality and random access into the movie will become more granular. The 
  191.     presets I've given should guide you as to sensible selections.
  192.  
  193. Once you have chosen a frame pattern, you'll need to select the amount of 
  194. compression you want to use. This is set by the I, P and B quantization 
  195. levels. The values the dialogs gives as defaults will usually make sense 
  196. but if you want to change them:
  197. 1) The values are restricted to the range 1 through 31 inclusive.
  198.     A quantization of 1 is the highest quality, a quantization of 31 is the 
  199.     lowest quality.
  200. 2) Normal quality is a quantization of about 8. Low quality is a 
  201.     quantization of about 16. High quality is about 6.
  202.  
  203. You can choose from various algorithms for generating P and B frames. I 
  204. haven't explored these in detail and they may change when I have time to 
  205. look at them. For now the important things to note are 
  206. 1) They all seem to generate about the same quality, and about the same 
  207.     file size.
  208. 2) They are ordered in the menus by speed, with the fastest ones first.
  209. 3) The B-frame exhaustive search will take approx forever to do anything. 
  210.     Try it once to see what I mean, but don't expect to use it for anything 
  211.     useful.
  212. As I explore these more and start diddling the code, I'll provide more 
  213. explanation.
  214.  
  215. If you save to MPEG, because of the non-causal algorithms used by MPEG 
  216. compression, frames are not compressed in the order they are displayed. 
  217. This means that if you are using B-frames and stop the compression before 
  218. it reaches the end of the source movie, the encoder may have queued up 
  219. some frames it needs to compress to make the MPEG file consistent. 
  220. If this is the case, Sparkle will have to encode those queued frame before 
  221. it stops the compression, so it won't stop immediately. 
  222. The message window will tell you how many frames have been queued so you can see 
  223. how things are going. If you have the speech manager installed, Sparkle 
  224. will also tell you how many frames are left, which you may find more 
  225. convenient.
  226.  
  227. You can set the frame rate from a popup menu. When the dialog box opens, 
  228. the frame rate of the MPEG or QT movie you are converting has its frame 
  229. rate read in and used to set the initial frame rate. So usually you won't 
  230. want to change the frame rate. Note that there are a limited set of frame 
  231. rates because MPEG only supports a very few frame rates. So the best one 
  232. possible is chosen.
  233. Note also that frames are laid down with that frame rate which may cause 
  234. the movie to speed up or slow down. No frame interpolation is done to 
  235. ensure that perception remains correct across frame rate variation. 
  236. This'll be changed at some point, but is not a high priority compared to 
  237. sound.
  238.  
  239. ------------------------------------------------------------------------------
  240. MENU OPTIONS
  241.  
  242. Here are various points related to the menu options:
  243.  
  244. • File| Save As: 
  245.     This allows you to start saving a movie or pseduo-movie 
  246.     (made from a set of PICTs) as an MPEG or QuickTime file. Once you start 
  247.     the save it continues in the background. This menu item changes to 
  248.     File| Stop Saving which will stop the saving at once. 
  249.     You may want to pause the saving but not stop it, for example so that 
  250.     you can play another movie at top speed. To pause, simply click anywhere 
  251.     in the movie controller or type any key.
  252.     When the saving is busy working away the movie controller play button 
  253.     shows a pause symbol, because if you click there it will pause the saving.
  254.     When the saving is paused, the movie controller play button shows a play 
  255.     symbol because if you click the saving will resume.
  256. • Image|Grow or Shrink
  257.     The scaling of the window at any time is given in the title bar. 
  258.     When the title starts with *1, the movie is its natural size. 
  259.     With *2 the movie has been doubled in size. 
  260.     With /2 the movie has been halved in size.
  261.     For now if you expand or shrink movies beyond their natural size 
  262.     playback will be much slower and quality may not be as good. I'll be 
  263.     adding code to fix this soonish.
  264.     
  265. • Image| Hide All
  266.     You can hide or show all the decorations below the movie windows. The 
  267.     easiest way to do this is with the tab, shift-tab and control-tab keys, 
  268.     or with command-H. You may want to do this because the decorations 
  269.     irritate you or because hiding the decorations makes playback speed a 
  270.     few percent faster.
  271.  
  272. • Video| Play All Frames: 
  273.     If this is set, every frame of the movie will be played. The movie will 
  274.     try to play in real time, but may be slower than real time if necessary. 
  275.     It will never be faster than real time. 
  276.     With quicktime movies sound is disabled when this option is on.
  277.     When this option is off, the movie will play back in real time which may 
  278.     mean skipping some frames. For MPEGs, how well this works depends on how 
  279.     fast your mac is. (Also read the section on play rate below.)
  280.     
  281. • Video| Play at Double Speed:
  282.     These options set the  movie to play twice as fast, at the normal rate, 
  283.     or twice as slowly. Note that if Play All Frames is active, playing the 
  284.     movie at double speed may be no faster than playing it at normal speed 
  285.     because both ways the calculation of each frame is overloading the mac.
  286.     Some MPEGs look jerky and too fast when played at their normal speed and 
  287.     with Play All Frames switched off. This is because the MPEGs have been 
  288.     encoded at too high a frame rate. For example the original movie may 
  289.     been sampled at 12 frames per second but it's encoded as an MPEG of 24 
  290.     (or 23.976) frames per second. This happens because the lowest possible 
  291.     frame rate with MPEG is 23.976 fps. So if this happens, you may want to 
  292.     set the MPEG to play at half speed. 
  293.     You can also control the speed at which movies play by command-clicking 
  294.     in the steppers of the movie controller.
  295.  
  296. • Video| Faster: 
  297.     If you set this option, whenever Sparkle is busy, either playing movies 
  298.     or encoding movies, it will not yield time to background applications. 
  299.     This makes playback a little faster and smoother. 
  300.     However if you have an application doing something in the background,
  301.     for example a modem download or a background compile, you might want to 
  302.     deselect this option.
  303.  
  304. ------------------------------------------------------------------------------
  305. MPEG PLAYBACK PREFERENCES
  306.  
  307. The MPEG Playback Preferences dialog (use command-R or look under the 
  308. Preferences menu under the Edit menu) allows you to set general playback 
  309. preferences. Most of these are concerned with how you wish to balance 
  310. playback speed against playback quality. Note that whatever settings you 
  311. choose for playback, when you save an MPEG file to another format all 
  312. settings are switched to the highest quality while the save is in 
  313. progress, so you don't need to worry about losing quality that way.
  314.  
  315. • Clip YCrCb:
  316.     What this refers to is an intermediate stage in the MPEG decoding. The 
  317.     values for Y, Cr and Cb should be between 0 and 255 but some MPEGs are 
  318.     encoded so that some Y or Cr or Cb values are calculated to be below 0
  319.     or above 255. If you don't select this option, Sparkle doesn't check the 
  320.     Y Cr Cb values and clip them if they are out of bounds. This makes 
  321.     playback about 10% faster, but may (if the values are out of bounds) 
  322.     lead to dots of incorrect color or black dots in areas of white or 
  323.     suchlike.
  324.  
  325. The other quality options are used depending on the screen depth of the 
  326. screen on which the MPEG is playing. So if your MPEG is on a 16-bit 
  327. screen, the 16-bit color options are used.
  328. • Use 4x4 IDCT:
  329.     One time-consuming part of MPEG decoding is the IDCT which is somewhat 
  330.     like a Fourier transform. This should be performed using a matrix of 8x8 
  331.     coefficients. If you select this option only a 4x4 subset of that matrix 
  332.     will be used. This makes the calculation a lot faster, but the cost is 
  333.     some blurriness to the image which is usually acceptable.
  334. • For 24-bit screens. Clip RGB.
  335.     This is the same sort of issue as the Clip YCrCb note above, only 
  336.     occurring at a later stage in processing. Some MPEGs look fine with 
  337.     neither form of clipping, some only need one or the other, and some need 
  338.     both. (This option is not an issue for 8 and 16 bit screens because they 
  339.     use a different way of calculating RGB for their display---not as high 
  340.     quality as the 24-bit method, but good enough for the given screen 
  341.     depth.)
  342. • For 8-bit color screens. Dither options:
  343.     You have a choice of three dither options on an 8-bit screen. 
  344.     Fast dithering uses an algorithm I invented. It is phenomenally fast, 
  345.     but not the greatest quality. It looks especially bad for things that 
  346.     need very sharp edges, like text. (It also uses 128K of storage to do its 
  347.     thing, so if you're low on space you may want a different option.
  348.     When this option is activated for the first time --- for example when 
  349.     you switch to 8-bit colors screen depth from some other depth, or when 
  350.     you first open an MPEG under 8-bit screen depth --- these 128K of tables 
  351.     have to be calculated which takes about 1.5 sec on my Quadra 610. 
  352.     In a future version of the code I'll implement ideas I have for removing 
  353.     this delay.)
  354.     Use 16-bit pixmap calculates everything as for a 16-bit screen (so it 
  355.     uses the 16-bit color setting for Use 4x4 IDCT). Then the 16-bit pixmap 
  356.     is dithered to the screen using QuickDraw. This gives much better 
  357.     results but is much slower than my fast dithering.
  358.     Use 24-bit pixmap works like 16-bit pixmaps, but all calculations are in 
  359.     24-bits. This gives the best results, but is even slightly slower than 
  360.     the 16-bit pixmap case and uses more memory.
  361.     I hope to improve the quality of the fast dithering algorithm in the 
  362.     near future. 
  363.     Also at some point I'll add code to allow you to set an optimal palette
  364.     when playing on 8-bit color screens. At present I simply use whatever 
  365.     palette the screen is using, usually the system palette.
  366. • For 8-bit grey screens:
  367.     Two points to note. 
  368.     * Is your graphics card set to grey mode? If you have a grey screen but in the 
  369.     monitors control panel you have set your graphics card to color, Sparkle 
  370.     will think it's on an 8-bit color screen. This will give you slower 
  371.     playback and lower-quality results.
  372.     * For the fastest possible playback, I assume that the screen palette is 
  373.     set to the system palette. On an 8-bit grey screen there is never any 
  374.     reason to change this. Nonetheless, some applications feel they simply 
  375.     have to perform this pointless exercise whose only effect is to reduce 
  376.     the quality of what's displayed by other applications. (Would you be at 
  377.     all surprised to learn that Word, one of the masterpieces from those 
  378.     geniuses at Redmond, is such an application? I though not.) 
  379.     What this means is that if you are running Word (or another of these 
  380.     ill-behaved applications) in the background, Sparkle will playback MPEG 
  381.     files somewhat slower than it should.
  382.  
  383. In summary: 
  384. The fastest playback possible is on a 8-bit grey screen, followed by 
  385.   8-bit color, then 16-bit color, then 24-bit color. 
  386. For fastest playback, deselect the ClipYCrCb option, 
  387.   select the Use 4x4 IDCT option, 
  388.   for 8-bit color use fast dithering or
  389.   for 24-bit color deselect the ClipRGB option,
  390.   and use command-H to hide all the decorations below the video window.
  391. For highest quality playback, use the deepest screen-depth you can,
  392.   select ClipYCrCb and (on 24-bit screens) ClipRGB,
  393.   deselect the Use 4x4IDCT option,
  394.   if you are on an 8-bit color screen select the 24-bit pixmap option.
  395.   
  396. Decoding MPEGs requires lots of computation, but can be made faster by 
  397. sacrificing some quality. I've tried to allow you to make your own choice 
  398. about which you prefer. But remember I can't work miracles. For example I 
  399. can't magically give you an 8-bit color dither algorithm that gives the 
  400. same quality as the QuickDraw but runs at the speed of my fast dithering. 
  401. I'll try to improve the quality of the high-speed options in future, but 
  402. I can't promise anything.
  403.  
  404. The one other item in this dialog box is the 
  405. "Prefer 8-bit color to 8 bit-grey" checkbox. This is only relevant to 
  406. people who have more than one screen, at least one of which is grey and 
  407. at least one of which is color. 
  408. When Sparkle opens a file it orders all the screns available by screen 
  409. depth and tries to open a window on the deepest depth screen. But if you 
  410. have one screen set to 8-bit grey and the other set to 8-bit color it 
  411. can't know which you'd prefer, hence this setting. You may prefer the 
  412. color screen because any color is better than none, or the grey screen 
  413. because it gives faster playback and no fuzziness from dithering.
  414. (After ordering the screens by depth, Sparkle notes where other movie 
  415. windows have been placed and tries to place the new window so it doesn't 
  416. overlap any of the old windows. Also, if the window opened is large than 
  417. any screen, it will be opened at half size or whatever so it does fit on 
  418. the screen. I hope you like this algorithm. It works better than what 
  419. every other program I've seen uses. If you have comments about it, please 
  420. mail me.)
  421.  
  422. ------------------------------------------------------------------------------
  423. PICT FILES AND PSEUDO-MOVIES
  424.  
  425. Sparkle can open a set of PICT files to convert them to an MPEG or QT 
  426. movie. This may be useful if you have enough program, like a graphing 
  427. program, that creates a set of PICTs, or if you have a set of medical 
  428. scans or such. 
  429.  
  430. The only picture format Sparkle understands is PICT, the Mac standard 
  431. picture format. I do not plan to change this because there are lots of 
  432. programs out there, many of them free and many of them capable of running 
  433. in batch, that will convert whatever format you have to PICT.
  434.  
  435. Once you have your pictures in PICT format, they need to be in the same 
  436. folder and given the same name so that Sparkle can link them together.  For 
  437. example, if these pictures represent x-rays of your head, call them 
  438. myHead.1, myHead.2, etc.  They must be named name.# where name is common to 
  439. all files and # is a number.  The numbers don't have to start at zero or 
  440. one, and don't have to be contiguous.  However they must all be positive 
  441. integers.
  442.  
  443. From the open files dialog open one of your PICTs---whichever one you get 
  444. to first, it doesn't have to be the lowest numbered one. Sparkle will 
  445. scan the folder for other PICT files with that name and a number added, 
  446. order the files it finds, and display them all in a movie window. 
  447. You can now treat this pseudo-movie like any other movie. You can grow or 
  448. shrink the window, step forwards or backwards, etc. You can play the 
  449. movie if you like, but for these PICT pseudo-movies I set the framerate 
  450. to only one frame per second. Decoding a PICT can be fairly slow---it 
  451. involves disk access and lots of memory---so don't expect this to work 
  452. wonderfully. You can now save the pseudo-movie as an MPEG or QT movie 
  453. just as you would normally.
  454.  
  455. The PICTs may be different sizes, but the window opened will be the size of 
  456. the PICT you select in the open file dialog box. The other PICTs will be 
  457. scaled to fit this size window and may not look too good. I wouldn't 
  458. recommend using a set of PICTs that aren't all the same size.
  459.  
  460. Note that for now I don't do anything special when I draw the pictures. 
  461. In particular this means on screens that aren't 24-bit or 16-bit I don't 
  462. dither the picture. This will be fixed fairly soon. For now everything 
  463. all works and it doesn't affect the quality of movies you create.
  464. I'll also be adding code to save MPEGs or QuickTime movies as a set of 
  465. PICTs fairly soon.
  466.  
  467. ------------------------------------------------------------------------------
  468. FAQs (Frequently asked questions).
  469.  
  470. • I try to play MPEGs but my Mac starts speaking numbers or asks me over and 
  471. over to select a voice.
  472.     You have the Speech Manager installed on your Mac including a little 
  473.     extension called ``Speech Media Handler''. Speech Media Handler speaks
  474.     the text of movies that include a text track, and Sparkle plays MPEGs 
  475.     by creating a dummy text track as part of the process of faking QuickTime 
  476.     into accepting MPEGs. I'd recommend ditching Speech Media Handler. I've 
  477.     never seen a place where it is useful and right now it's kinda a cute toy 
  478.     idea that escaped from Apple. Maybe in a few months they'll give it a 
  479.     programmer interface and make it more useful.
  480.     
  481. • I've downloaded (or uploaded) an MPEG using Mosaic/WWW and when I try to 
  482. play it Sparkle says it's not an MPEG file. But if I ftp the file with 
  483. Fetch or suchlike it works fine. What's happening?
  484.     Be very careful when transferring files over the Internet with MacBinary.
  485.     Fetch and many such programs automatically strip MacBinary from files,
  486.     but Mosaic does not appear to (maybe this will be fixed soon). So 
  487.     if an MPEG is stored at a Mosaic site using MacBinary, all Mosaic users
  488.     trying to download it will have problems.
  489.  
  490. • Why when I try to step back one frame do I sometimes step back 5 or six 
  491. frames?
  492.     You are viewing an MPEG with P or B frames. Because of the way these 
  493.     frames are compressed, it would take a lot of computation (ie be slow) to 
  494.     jump exactly to the frame you want, so I jump to the nearest frame that 
  495.     can be calculated at reasonable speed. If you want to know more, read the 
  496.     technical note in this package.
  497. • Why when I try to random access a frame do I get sent to the same set of 
  498. frame numbers always?
  499.     Same reason as above.
  500.  
  501. • Why does my MPEG have the occasional block of garbage, mostly colored 
  502. green?
  503.     Some part of the MPEG file has become corrupt. This usually happens with 
  504.     MPEG files that have been uuencoded and have had a character or two lost 
  505.     or changed.
  506. • Why are large parts of my MPEG filled with green garbage, or with parts 
  507. of earlier scenes.
  508.     You have probably downloaded the MPEG file using gopher or ftp in ASCII 
  509.     format. The file is now useless. Download it again using BINARY mode. 
  510.     Better still, set your gopher or ftp application always to download .MPG 
  511.     suffix files in BINARY---don't trust its AUTOMATIC mode.
  512. • Why is the first frame of my MPEG all green?
  513.     Some people out there when they create an MPEG file, randomly start it 
  514.     where they feel like it. 
  515.     The consequence is that the first some bytes of the file are garbage and 
  516.     appear as an all green first frame. 
  517.     If you have one of these MPEGs, whenever you jump to the first frame, you 
  518.     won't see the first frame, but simply the last frame you were looking at. This 
  519.     is a consequence of the way Sparkle handles errors in the MPEG file format. 
  520.     Mostly it works well, but in this particular case it isn't great.
  521.     It is not too easy to work around this because of the many different ways
  522.     in which the MPEG can have garbage at the start before valid data begins.
  523.  
  524. • Why at the end of an MPEG is the last frame the same as the second to 
  525. last frame?
  526.     Some MPEGs just are created this way, with the last two frames as 
  527.     duplicates. This is a problem with those files, not a bug in Sparkle, and 
  528.     one just has to accept it. 
  529.     A similar type problem is that some video that's been converted to 30fps 
  530.     from 24fps film has duplicate frames every so often, and agin one just 
  531.     has to accept this for now.
  532.  
  533. • What does the Thread Manager do? Why do you make such a fuss over it?
  534.     The Thread Manager provides a way for a programmer to create a number of 
  535.     tasks within an application and have those tasks all run together. So 
  536.     with Sparkle every time the user asks for something that will takes some 
  537.     time, like playing an MPEG or saving a file in some different format, I 
  538.     create a task that does that work. If the Thread Manager isn't present, 
  539.     you, the user, can't create a number of these tasks and switch between 
  540.     them---you are restricted to doing only one thing at a time.
  541.  
  542. • When I started saving a file to MPEG, it got through two frames then sat there
  543. doing nothing for a long long time. Did it crash?
  544.     Especially when saving to MPEG, Sparkle creates a large number of blocks 
  545.     of memory. If the mac runs out of memory partway through performing 
  546.     this saving, it will run around trying everything it can to scrounge memory.
  547.     On my Quadra 610 I have seen it sit there for 45 seconds trying to free up 
  548.     memory before it concludes that there's nothing it can do and pops up an
  549.     error message. I guess on slower machines it might sit there for up to two
  550.     minutes. Just be patient and wait a while before concluding things
  551.     have crashed.
  552.  
  553. • Will you create a PowerPC native version? A version that uses the DSP in 
  554. the AV macs?
  555.     I don't have a PPC or an AV mac, and unless someone buys me one, I won't 
  556.     have either for sometime. Maybe when Symantec offer a Think C 7 that 
  557.     compiles to PowerPC, someone out there with a PowerPC will be able to 
  558.     do the compile for me. Until then, I'm afraid this is all that I can do.
  559.  
  560. • Where can I get MPEG files?
  561.     An ftp sites is 2k-ftp.CS.Berkeley.EDU in pub/multimedia. 
  562.     (This site used to be called toe.cs.berkeley.edu.)
  563.     
  564.     Here are some WWW sites
  565.     http://www.ccsf.caltech.edu/~johns/sl9.html  (CalTech)
  566.     http://newproducts.jpl.nasa.gov/sl9/images.html  (JPL)
  567.     http://seds.lpl.arizona.edu/sl9/sl9.html  (U. Arizona)
  568.     
  569. • Where can I find more about MPEG?
  570.     Read the UseNet MPEG FAQ. This is published in news.answers every so 
  571.     often, and can be ftp'd as         
  572.         host: ftp.cs.tu-berlin.de
  573.         file: /pub/msdos/windows3/graphics/mpegfaXX.zip
  574.     (XX is a version number).
  575.      Yeah, it's a zip file and that sucks, but that's life. There are a bunch 
  576.      of mac deZip'ers around so grab one and use it.
  577.      The latest version of this file as of July 94 to be 3.1.
  578.  
  579. • How can I deal with AVI files?
  580.     At mac.archive.umich.edu (and probably at sumex) 
  581.     in /mac/graphics/graphicsutil is vfw1.1utilities.sit.hqx
  582.     which handles AVI files and is supposed to work pretty well. 
  583.     
  584.  
  585. • Do I know of a program that ...?
  586.     Not really. 
  587.     I know of no Mac program that handles MPEG sound, or MPEGs with a .WAV 
  588.     file. There is source code floating around that converts MPEG sound to 
  589.     and from 16bit 44.2kHz samples, but it does not deal with MPEG 
  590.     video/audio synching and thus isn't yet of much use.
  591.     I know of no Mac program that can play windows AVI files.
  592.     My next major task is handling sound. 
  593.     But until I am done with that, I'm afraid you're out of luck.
  594.  
  595. ------------------------------------------------------------------------------
  596. WHY DOESN'T SPARKLE DO...
  597.  
  598. •    Why doesn't Sparkle read .gl, .dl and .fli files?
  599. One reason is that those file formats are awful. They give these dinky 
  600. low contrast horribly dithered images no-one would want to look at, and 
  601. they usually only have about 10 frames. Maybe, years from now, I'll add 
  602. those conversions, but they're about as low a priority as you get.
  603. At mac.archive.umich.edu (and probably at sumex)
  604. in /mac/graphics/graphicsutil is macanimviewer1.01.sit.hqx 
  605. which handles these various cheapo formats so you might want to grab it.
  606.  
  607. •    What about audio?
  608. MPEG has audio compression as well as video compression. I've been doing 
  609. lots of reading into this and pretty soon will start coding for it.
  610.  
  611. •    What about Video for Windows?
  612. I would be nice to support .AVI files. But right now I know nothing about 
  613. .AVI beyond the fact that it exists. Again any info anyone has is 
  614. appreciated. Until I know how .AVI works, how it fits into the windows 
  615. environment etc, I can't even tell you if it's practical for Sparkle to 
  616. try to support .AVI, let alone start the necessary coding.
  617.  
  618. •    Why don't you write an MPEG codec?
  619. Under QT 1.x there was no compelling need for this and no way to do it.
  620. QT 2.0 has some hooks for the use of MPEG. However when I tried beta's of 
  621. QT 2.0 on MPEG handling they consistently crashed. So for now I'm waiting 
  622. until the QT 2.0 MPEG framework is stable and actually works. When that 
  623. happens I'll consider things again.
  624.  
  625. •    Will I make the source available? 
  626. Yes, at some point. I had hoped to do so this release, but while the code 
  627. is 95% clean and readable, it's still not perfect, and don't yet think 
  628. it would help anyone much.
  629.  
  630. ------------------------------------------------------------------------------
  631. SMALL THINGS YOU MIGHT NOT HAVE NOTICED
  632.  
  633. The movie controller behaves pretty much like a standard QT controller. 
  634. You can step forward and backwards, hold down those buttons to play 
  635. forwards or backwards and click or drag in the central region to go to a 
  636. random point. 
  637. You can use the forward and backward arrow keys to step. 
  638. You can option click in the forward and backward steppers to go to the 
  639. beginning or end of the MPEG. Likewise using option forward or backward 
  640. arrow.
  641. You can start the movie playing using either return, spacebar, or 
  642. command forward arrow. You can stop playing using spacebar or return.
  643. You can yet play backwards by using command backward arrow. 
  644.  
  645. The visual clue that the movie is being saved is that 
  646. the movie controller loses its steppers. This is not a particularly 
  647. obvious fact and may at some point be changed. For now it works once you 
  648. realize this fact.
  649.  
  650. When a movie is being saved, you can either stop the conversion 
  651. or pause it. To stop the conversion, use command-S (or the equivalent 
  652. menu option.) This will save the movie using the frames created so far.
  653. To pause the conversion use command-P, or the equivalent menu option, or 
  654. click on the movie controller's play/pause button. The  
  655. saving will stop until you start that movie playing again. This is 
  656. occasionally useful if you want to pause a cinepak conversion to do a 
  657. short job on your mac.
  658. You can tell whether a movie is actively being saved or paused being 
  659. saved by looking at the indicator in the title bar. 
  660. If the first character in the title bar is 
  661.   S the movie is actively being saved,
  662.   P the movie is paused being saved,
  663.   R the movie is in realtime playback mode
  664.   A the movie is in play-all-frames playback mode.
  665.  
  666. If you are partway through a movie and save, the movie will be 
  667. rewound to the beginning for you. You do not need to be at the start of a 
  668. movie to save.
  669.  
  670. You can set the temporal quality options when saving to QuickTime 
  671. separately from the spatial quality options. If you need to do this, hold 
  672. down the option key while using the quality slider, and it will become a 
  673. temporal quality slider. 
  674.  
  675. ------------------------------------------------------------------------------
  676. THE FUTURE
  677.  
  678. The basic outline for now is
  679.     2.5 Cleaned up faster, smaller version of 2.0.
  680.     3.0 Handles sound.
  681.     3.5 Cleaned up faster, smaller version of 3.0.
  682. While adding these large additions I'll fix small things as I go, and as 
  683. I have time. I don't see the user interface improving much for some 
  684. time---more important things need my time.
  685.  
  686. I also want to add stuff to allow us to create movies. Morphs, special 
  687. effects, that sort of thing.
  688.  
  689. ------------------------------------------------------------------------------
  690. HOW CAN YOU HELP IMPROVE SPARKLE?
  691.  
  692. •    Any info on psycho-acoustic encoding?
  693. •    Any info on Microsoft Video for Windows?
  694. •    Why is QuickTime so slow about creating text track movies? If you have 
  695.     code that creates text track movies fast, please show it to me.
  696. •    Any bug reports.
  697. •    Any ideas you have or suggestions. Your suggestions may go onto the 
  698.     list of things to do (currently two pages of single line items) but will 
  699.     probably be acted upon at some point. People have suggested several 
  700.     things to me I would not have thought of myself, so I do want your 
  701.     feedback.
  702. ------------------------------------------------------------------------------
  703. THANKS
  704.  
  705. * Many people all over the internet have helped me write this code.
  706. * Thanks to the people at Berkeley. Even though I've completely replaced 
  707.     their MPEG playback code with my own, they helped get this project started.
  708.     And, until I rewrite it, I'm using their MPEG encoding code.
  709. * Thanks to various usenet personalities who answered mac programming 
  710.     questions, mailed me quicktime header files and such. Special thanks to 
  711.     ldo in New Zealand, and Jon W{tte in Sweden, and bryanw, keeper of the 
  712.     MPEG FAQ, who mailed me about the Stanford MPEG encoder.
  713. * A special individual thank you goes to DS (he didn't want me to give his 
  714.     name but he knows who he is.) DS mailed me a CD ROM and ten floppies of 
  715.     information about QuickTime components after I complained that Apple was 
  716.     not making this information easily available. He's also provided me with 
  717.     information on QT 2.0 which will gradually be assimilated into Sparkle.
  718. * Thanks to Gene Chalfant who passed on a paper from NASA containing some 
  719.     interesting ideas on IDCT alternatives. 
  720. * Thanks to the mystery person in Britain who sent me some QT 2.0 
  721.     information in an envelope with no name attached to it.\
  722. * Thanks to Jamie McCarthy for code for touching Finder folders.
  723. * Thanks to Troy Gaul for the Infinity Windoid.
  724. * Thanks to Richard Lim for the current set of icons used by Sparkle.
  725.     (Which I modified a little so it's probably best to blame me rather than 
  726.     him for poor design choices if you don't like them.)
  727. * Thanks to Stuart Cheshire for mailing me a QT 2.0beta CD-ROM and misc 
  728.     useful info.
  729. * Thanks to everyone who's mailed in bug reports or suggestions. Even when 
  730.     I can't implement suggestions at once, they go on the list for inclusion 
  731.     in a few months. 
  732. * Thanks to Apple for making the greatest computers in the world. 
  733.     (Though sadly they seem to be going completely clueless with regard to 
  734.     how to distribute their various new ideas. I fear if they don't get their 
  735.     act together about this soon, NO-ONE will support these new things 
  736.     because developers will have no idea whose machine has what on it.)
  737. * Thanks also to Symantec for creating such a great programming environment.
  738.     This program was written with Think C 5, then Think C 6  and now Think C 7 
  739.     using the Think Class Library. Having coded on Windows, X-windows, and 
  740.     the Mac, I can unreservedly say that the Mac is by far the most pleasant 
  741.     platform for a programmer.
  742.  
  743. (If I've forgotten your name here by mistake and you really deserve to be 
  744. here, please remind me.)
  745.  
  746. Maynard Handley 
  747. maynard@elwing.otago.ac.nz
  748. July 20 1994